<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<ui:composition
	template="/WEB-INF/facelets/templates/templateAsesor.xhtml">
	<ui:define name="content">
	<h3 align="center" style="color: #FF9900">Editar Cuenta</h3>
		<br />
		<br />
		Edita los datos de tu cuenta a continuación.
		<br/>
		<br/>
		<a4j:form>
			<h:panelGrid columns="2">

				<h:outputText value="Identificación:" />

				<h:outputLabel value="#{asesorBean.asesor.identificacion}" />


				<h:outputText value="Dirección:" />
				<h:inputText value="#{asesorBean.asesor.direccion}"
					style="width: 300px; " />

				<h:outputText value="Telefono:" />
				<h:inputText value="#{asesorBean.asesor.telefono}"
					style="width: 300px; " />

				<h:outputText value="Email:" />
				<h:inputText value="#{asesorBean.asesor.email}"
					style="width: 300px; " />
				<h:outputText value="Clave:" />
				<h:inputSecret value="#{asesorBean.asesor.clave}"
					style="width: 300px; " />

				<h:commandButton value="Aceptar"
					action="#{asesorBean.modificarAsesor}" oncomplete="submit()"></h:commandButton>
			</h:panelGrid>
		</a4j:form>
		

		<style>
			.top {
				vertical-align: top;
			}
			
			.info {
				height: 202px;
				overflow: auto;
			}
		</style>

		<h:form>
			<h:panelGrid columns="1" columnClasses="top,top">
				<rich:fileUpload fileUploadListener="#{fileUploadBean.listener}"
					maxFilesQuantity="#{fileUploadBean.uploadsAvailable}" id="upload"
					immediateUpload="#{fileUploadBean.autoUpload}"
					acceptedTypes="jpg, gif, png, bmp"
					allowFlash="#{fileUploadBean.useFlash}">
					<a4j:support event="onuploadcomplete" reRender="info" />
				</rich:fileUpload>
				<h:panelGroup id="info">
					<rich:panel bodyClass="info">
						<f:facet name="header">
							<h:outputText value="Información de los archivos subidos" />
						</f:facet>
						<h:outputText value="No hay archivos actualmente subidos"
							rendered="#{fileUploadBean.size==0}" />
						<rich:dataGrid columns="1" value="#{fileUploadBean.files}"
							var="file" rowKeyVar="row">
							<rich:panel bodyClass="rich-laguna-panel-no-header">
								<h:panelGrid columns="2">
									<a4j:mediaOutput element="img" mimeType="#{file.mime}"
										createContent="#{fileUploadBean.paint}" value="#{row}"
										style="width:100px; height:100px;" cacheable="false">
										<f:param value="#{fileUploadBean.timeStamp}" name="time" />
									</a4j:mediaOutput>
									<h:panelGrid columns="2">
										<h:outputText value="File Name:" />
										<h:outputText value="#{file.name}" />
										<h:outputText value="File Length(bytes):" />
										<h:outputText value="#{file.length}" />
									</h:panelGrid>
								</h:panelGrid>
							</rich:panel>
						</rich:dataGrid>
					</rich:panel>
					<rich:spacer height="3" />
					<br />
					<a4j:commandButton action="#{fileUploadBean.clearUploadData}"
						reRender="info, upload" value="Clear Uploaded Data"
						rendered="#{fileUploadBean.size>0}" />
				</h:panelGroup>
			</h:panelGrid>
		</h:form>

	</ui:define>

</ui:composition>
</html>